﻿#pragma once

#include "common.h"
#include "font.h"
#include "base.h"
#include <vector>

namespace anip
{
	class Shape;
	class Shader;
	class Texture2D;

	namespace vg
	{
		class Text : public Primitive
		{
			serializable_id(Text, 50674144);

		private:
			class Renderer;

		public:
			// cannot be serialized
			//TextRenderer::Options options;
			KeyedValue<wstring> text;
			kvec2 position;
			kcolor color = Colors::black;
			kfloat lineSize = 0.1f;
			kfloat maxWidth = 10000.0f;
			kfloat lineSpacing = 0.01f;
			Font font{};

			Text(const Font& f = Font(), 
				const wstring& text = L"", 
				invec2 pos = { 0, 0 });

			vec2 estimateSize(float time);

			bool isInside(invec2 p, float time) override
			{
				return false;

				// ANIP_TODO
			}

			GraphicsRenderer* createRenderer() override;
		};
	}
}